#ifndef COLLISION2D_COULOMB_H
#define COLLISION2D_COULOMB_H

#include <vector>

#include "../Tool/Macros.h"
#include "../Input/PicParams.h"
#include "../Species/Species.h"
#include "Collision1D.h"

class Collision1D_Coulomb : public Collision1D
{

public:

    Collision1D_Coulomb(PicParams* params_, CollisionParameter collision_param_, int collision_number_);

    ~Collision1D_Coulomb();

    virtual double cos_chi(double);

    virtual void collide(PhysicalField* fields, vector<Species*>& vecSpecies, Diagnostic* diag, int itime);


private:
    int n_species;
    int n_collision_pairs;

    //calculate for all cells
    vector<int> iSpec1, iSpec2;
    vector<bool> isIntra;
    vector<double> mr1, mr2, m12, m1_inv, m2_inv, gamma1, gamma2;

    vector<double> debye_length;
    vector<vector<double>>  log_coulomb;

    //calculate for each cells
    vector<int> n_indexes, isOdd;
    vector< vector<int> > index;
    vector<int> bmin;
    vector<int> n_particle;
    vector<int> n_particle_begin;
    vector<double> density;
    double density_all;
    double density_all_inv;

    double twoPi, e_ov_ephi0, time_coulomb;

    void cal_collision_pairs();
    void cal_log_coulomb(PhysicalField* fields);

};


#endif
